import { NavBar } from 'antd-mobile'
import React from 'react'
import { getTicketListApi } from '../../api/ticket'
import { useNavigate, useSearchParams } from 'react-router-dom'
import styles from './css/ticket.module.css'
function Ticket() {
    const [sp] = useSearchParams()
    const nav=useNavigate()
    return (
        <div>
            <div className={styles.navBox}>
                <NavBar>北京-上海</NavBar>
            </div>
            
            <div className={styles.box} onClick={()=>nav('/seat')}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
            <div className={styles.box}>
                <span>
                    T8
                </span>
                <span>
                    北京
                </span>
                <span>
                    上海
                </span>
                <span>
                  06:20
                </span>
                <span>
                    11:58
                </span>
                <span>
                    ￥576
                </span>
                <span>
                    二等
                </span>
                <span>一等</span>
                <span>商务</span>
            </div>
        </div>
    )
}

export default Ticket

export const loader = async () => {
    const { data: res } = await getTicketListApi(sp)
    console.log(res)
}